import WebsocketHeartbeatJs from 'websocket-heartbeat-js'
export const websocket = (address) => {
    return new Promise((resolve,reject)=> {
        if (window.WebSocket) {
            let url = new WebsocketHeartbeatJs({url:address.url})
            resolve(url)
        } else {
            reject({ error: '当前设备不支持 Websocket！' });
        }
    })
}